package com.xtz.mapper;

import com.xtz.domain.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * date: 2022/5/7 18:51
 *
 * @author xietianze
 */
@Mapper
@Repository
public interface AdminEmployeeMapper {
    /**
     * 添加管理员员工
     * @param employee
     * @return
     */
    int addEmployee(Employee employee);

    /**
     * 通过用户名查询
     * @param username
     * @return
     */
    Employee selectByUsername(String username);

    /**
     * 查询分页
     * @param name
     * @param page
     * @param pageSizes
     * @return
     */
    List<Employee> selectPage(@Param("name") String name, @Param("page")Integer page, @Param("pageSize") Integer pageSizes);

    /**
     * 查询总条数
     * @param name
     * @return
     */
    Long selectCount(@Param("name")String name);

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    Employee loginEmployee(@Param("username")String username,@Param("password")String password);

    /**
     * 通过id查询用户
     * @param id
     * @return
     */
    Employee selectEmployeeById(String id);

    /**
     * 通过id更新
     * @param employee
     * @return
     */
    int updateEmployeeById(Employee employee);
}
